package com.urms.mapper;

import com.urms.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserRoleMapper {
    Integer insertUserRole(@Param("userLoginName") String userLoginName,
                           @Param("userId") Integer userId, @Param("roleIds") Integer[] roleIds);

    List<UserRole> selectRoleByUserId(Integer userId);

    int deleteByUserId(@Param("userId")Integer userId);

    int selectUserByRoleId(Integer roleId);

    List<String> selectRoleNameByUId(Integer userId);
}
